# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=akonadi-contacts
pkgver=23.08.4
pkgrel=0
pkgdesc="Libraries and daemons to implement Contact Management in Akonadi"
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by akonadi
# ppc64le blocked by qt5-qtwebengine -> akonadi
arch="all !armhf !s390x !riscv64 !ppc64le"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later AND GPL-2.0-or-later AND BSD-3-Clause"
depends_dev="
	akonadi-dev>=$pkgver
	gpgme-dev
	grantlee-dev
	grantleetheme-dev
	kcodecs5-dev
	kcompletion5-dev
	kconfig5-dev
	kcontacts5-dev
	kdbusaddons5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	kmime-dev
	kservice5-dev
	ktextwidgets5-dev
	kwidgetsaddons5-dev
	kxmlgui5-dev
	libkleo-dev
	prison5-dev
	qt5-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/pim/akonadi-contacts.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/akonadi-contacts-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
710540203bca22f42e8c3622ea2897df3a07aadf62315e22a16e04b7ac78048c89f0c50ba1451e9ab4c287a988c236d38993aaa945656babb402ba3a4ef55878  akonadi-contacts-23.08.4.tar.xz
"
